#!/bin/bash

# N_ROW=4666
#N_ROW=10
N_ROW=4700

#N_COL=1248
N_COL=1250
FAST_MODE=0
FOUT_FNAME=tmp.bin


DAISY_CONFIG=`cat WKDIR`/daisy.ini

echo "*************************************************"
echo "> N_ROW       = ${N_ROW}"
echo "> N_COL       = ${N_COL}"
echo "> FATS_MODE   = ${FAST_MODE}"
echo "> FOUT_FNAME  = ${FOUT_FNAME}"

# exit;

n=1
nmax=10
out_cnt=0

while [ $n -le ${nmax} ]
do

#    div_val=$[ $n % 10 ]
#    if [ $div_val -eq 0 ]
#    then
#        FOUT_FNAME=./monitor_20231210/${out_cnt}.bin
#        out_cnt=$((out_cnt + 1))
#    fi
    
    FOUT_FNAME=./monitor_20231211/${n}.bin
#    echo ${FOUT_FNAME}
    
#    bin/restore_vod ${DAISY_CONFIG}
    bin/ccd290_readout -r ${N_ROW} -c ${N_COL} -f ${FAST_MODE} -o ${FOUT_FNAME}
#    bin/lower_vod ${DAISY_CONFIG}

    sleep 10

    n=$((n + 1))
done


echo "*************************************************"
